package message

type Dispatcher[A any, M IMessage] struct {
	processors map[ID][]func(ctx Context[A, M])
}

func NewDispatch[A any, M IMessage]() *Dispatcher[A, M] {
	d := &Dispatcher[A, M]{
		processors: make(map[ID][]func(ctx Context[A, M])),
	}
	return d
}

func (d *Dispatcher[A, M]) Register(iMsg M, processors ...func(ctx Context[A, M])) error {
	return nil
}

func (d *Dispatcher[A, M]) MustRegister(iMsg M, processors ...func(ctx Context[A, M])) {
	if err := d.Register(iMsg, processors...); err != nil {
		panic(err)
	}
}

func (d *Dispatcher[A, M]) Dispatch(iActor A, iMsg M) error {
	return nil
}
